package projectEuler.net;
public class Problem_001 {
	private static int sum;
	/**
	 * 
	 * @param n
	 * @return
	 */
	public static int sumOfDivisibleBy3or5(int n){
		init();
		calculate(n);
		putResult();
		return sum;
	}
	private static void init(){
		sum=0;
	}
	private static void calculate(int n){
		for(int i=3; i<n; i++)
			if((i%3==0)||(i%5==0))
				sum+=i;
	}
	private static void putResult(){
		System.out.printf("Result is: %d\n", sum);
	}
}
